const youdao = async (ctx) => {
    const url = `https://dict.youdao.com/jsonapi_s?doctype=json&jsonversion=4`
    const params = {
        q: JSON.parse(ctx.body).word,
        le: 'en',
        t: 4,
        client: 'web',
        sign: '624ee6ae324c8f44d2298a77b7ea2d1b',
        keyfrom: 'webdict',
    }
    const res = await fetch(url, { method: 'POST', body: JSON.stringify({...params}) }).then((res) => res.json());
    ctx.response.body = res
}

module.exports = youdao